<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <title>编辑修改</title>
</head>
<body>
<div class="container">
    <div class="jumbotron">
        <h1 class="display-4">编辑修改！</h1>
        <p class="lead">依据相应的正则规则，对上传的脚本文件进行逐行修改。</p>
        <hr class="my-4">
        <ul class="list-unstyled">
            <li class="media">
                <img class="mr-3" src="images/right/regex.png" alt="Generic placeholder image">
                <div class="media-body">
                    <h5 class="mt-0 mb-1">规则一</h5>
                    <p class="lead"><code>package com.example.tests;</code></p>
                    <p>修改为</p>
                    <p class="lead"><code>package cn.edu.suda.catalina.dataupdate.script;</code></p>
                </div>
            </li>
            <li class="media my-4">
                <img class="mr-3" src="images/right/regex.png" alt="Generic placeholder image">
                <div class="media-body">
                    <h5 class="mt-0 mb-1">规则二</h5>
                    <p class="lead"><code>import org.openqa.selenium.firefox.FirefoxDriver;</code></p>
                    <p>修改为</p>
                    <p class="lead"><code>import org.openqa.selenium.firefox.FirefoxDriver;</code><br>
                        <code>import org.openqa.selenium.chrome.ChromeOptions;</code></p>
                </div>
            </li>
            <li class="media">
                <img class="mr-3" src="images/right/regex.png" alt="Generic placeholder image">
                <div class="media-body">
                    <h5 class="mt-0 mb-1">规则三</h5>
                    <p class="lead"><code>public class Test {</code></p>
                    <p>修改为</p>
                    <p class="lead"><code>public class Test implements BaseScript, Serializable {</code></p>
                </div>
            </li>
            <li class="media my-4">
                <img class="mr-3" src="images/right/regex.png" alt="Generic placeholder image">
                <div class="media-body">
                    <h5 class="mt-0 mb-1">规则四</h5>
                    <p class="lead"><code>driver = new FirefoxDriver();</code></p>
                    <p>修改为</p>
                    <p class="lead"><code>ChromeOptions chromeOptions = new ChromeOptions();</code><br>
                        <code>chromeOptions.addArguments("--start-maximized");</code><br>
                        <code>driver = new ChromeDriver(chromeOptions);</code></p>
                </div>
            </li>
            <li class="media">
                <img class="mr-3" src="images/right/regex.png" alt="Generic placeholder image">
                <div class="media-body">
                    <h5 class="mt-0 mb-1">规则五</h5>
                    <p class="lead"><code>public void test() throws Exception {</code></p>
                    <p>修改为</p>
                    <p class="lead"><code>public void test(String... args) throws Exception {</code></p>
                </div>
            </li>
            <li class="media my-4">
                <img class="mr-3" src="images/right/regex.png" alt="Generic placeholder image">
                <div class="media-body">
                    <h5 class="mt-0 mb-1">规则六</h5>
                    <p class="lead"><code>driver.findElement(By.linkText("信息")).click();</code></p>
                    <p>修改为</p>
                    <p class="lead"><code>driver.findElement(By.linkText("信息")).click();</code><br>
                        <code>try {</code><br>
                        <code>&nbsp;&nbsp;Thread.sleep(1000);</code><br>
                        <code>} catch (InterruptedException e) {</code><br>
                        <code>&nbsp;&nbsp;e.printStackTrace();</code><br>
                        <code>}</code></p>
                </div>
            </li>
            <li class="media">
                <img class="mr-3" src="images/right/regex.png" alt="Generic placeholder image">
                <div class="media-body">
                    <h5 class="mt-0 mb-1">规则七</h5>
                    <p class="lead"><code>driver.findElement(By.id("username")).sendKeys("苏大");</code></p>
                    <p>修改为</p>
                    <p class="lead"><code>driver.findElement(By.id("username")).sendKeys(args[0]);</code></p>
                </div>
            </li>
        </ul>
        <p class="lead">此处列出了七条规则，编辑修改工作将在服务端自动完成。请选择上传的脚本文件并开始编辑修改工作。</p>
        <div class="input-group">
            <select class="custom-select">
                <option selected>请选择...</option>
                <option value="1">One.java</option>
                <option value="2">Two.java</option>
                <option value="3">Three.java</option>
            </select>
            <div class="input-group-append">
                <button class="btn btn-danger" type="button" data-toggle="modal" data-target="#editModal">编辑修改</button>
            </div>
        </div>
    </div>

    <!-- 编辑修改 Modal -->
    <div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="editModalLabel">编辑修改</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                </div>
                <div class="modal-body">
                    <p class="lead text-center" id="editResult">修改成功！</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>